<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SHA1Fingerprint</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">SHA1Fingerprint()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Result$ = <font color="#006666"><b>SHA1Fingerprint</b></font>(*Buffer, Size)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Returns a 40 characters long SHA1 (Secure Hash Algorithm 1) hash code of the given memory buffer. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>*Buffer</i></td>
<td width="90%"> 
 
The buffer containing the data to be hashed. 

 

</td></tr>
<tr><td><i>Size</i></td>
<td> 
 
The size of the given buffer. 

 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Returns the hash code as a string. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



SHA1 can be used to calculate a checksum to verify that a 'message' has not been altered. Unlike 
<a href="crc32fingerprint.html">CRC32</a> it is nearly impossible to modify the original message and still 
produce the same SHA1 fingerprint. 
<br>
<br>
Here is a quick explanation taken from the RFC 3174 on SHA1: 
<br>
<br>
'The SHA-1 is called secure because it is computationally infeasible 
to find a message which corresponds to a given message digest, or to 
find two different messages which produce the same message digest. 
Any change to a message in transit will, with very high probability, 
result in a different message digest, and the signature will fail to 
verify.' 
<br>
<br>
More information can be found in the RFC 3174: 
<a href="http://www.ietf.org/rfc/rfc3174.txt">http://www.ietf.org/rfc/rfc3174.txt</a>. 

 

</blockquote><p><b>Example:</b> a string as memory buffer</p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  test.s = "This is a test string!"
  <b><font color="#006666">Debug</font></b> <font color="#006666">SHA1Fingerprint</font>(@test,<font color="#006666"> StringByteLength</font>(test))
</font></pre>

</blockquote><p><b>Example:</b> with memory buffer</p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  *Buffer =<font color="#006666"> AllocateMemory</font>(500)    
  <b><font color="#006666">If</font></b> *Buffer
<font color="#006666">    PokeS</font>(*Buffer, "The quick brown fox jumps over the lazy dog.")
    SHA1$ =<font color="#006666"> SHA1Fingerprint</font>(*Buffer,<font color="#006666"> MemorySize</font>(*Buffer))
    <b><font color="#006666">Debug</font></b> "SHA1 Fingerprint = " + SHA1$
<font color="#006666">    FreeMemory</font>(*Buffer)  <font color="#006666">; would also be done automatically at the end of the program</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="sha1filefingerprint.html">SHA1FileFingerprint()</a>, <a href="examinesha1fingerprint.html">ExamineSHA1Fingerprint()</a>, 
<a href="md5fingerprint.html">MD5Fingerprint()</a>, <a href="crc32fingerprint.html">CRC32Fingerprint()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=sha1filefingerprint.html>SHA1FileFingerprint()</a> - <a href=index.html>Cipher Index</a> - <a href=startaescipher.html>StartAESCipher()</a> -&gt;



</body></html>